package cn.zn.modules.pz.his.service.impl;

import cn.zn.modules.pz.his.entity.PzTraffic;
import cn.zn.modules.pz.his.entity.QPzTraffic;
import cn.zn.modules.pz.his.repository.PzTrafficRepository;
import cn.zn.modules.pz.his.service.PzTrafficService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class PzTrafficServiceImpl implements PzTrafficService {

    @Autowired
    private PzTrafficRepository pzTrafficRepository;

    @Override
    public List<PzTraffic> findByMainId(Integer ap, String mainId) {
        QPzTraffic qPzTraffic = QPzTraffic.pzTraffic;
        return (List<PzTraffic>) pzTrafficRepository.findAll(qPzTraffic.ap.eq(ap).and(qPzTraffic.mainId.eq(mainId)));
    }
}
